<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        点击次数: {{ counter }}
        <button @click="handleAdd()">+1</button>
        <button @click="handleAdd(10)">+10</button>
    </div>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <script>
        let app = new Vue({
            el: '#app',
            data(){
                return {
                    counter: 0
                }
            },
            methods:{
                handleAdd: function(count){
                    count = count || 1;
                    this.counter += count;

                }
            }
        })
    </script>
</body>
</html>